package cn.suzhang.jsharp.module.sys.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import cn.suzhang.jsharp.common.entity.BaseEntity;

/**
 * 资源表
 * 
 * @author suzhang
 * @since 2018-02-09
 */
@Entity
@Table(name = "sys_resource")
public class SysResource extends BaseEntity {

	private static final long serialVersionUID = 1L;

	/**
	 * 
	 * 资源名称
	 * 
	 */
	private String sourceName;

	/**
	 * 
	 * 资源唯一标识
	 * 
	 */
	private String sourceKey;

	/**
	 * 
	 * 资源类型,0:目录;1:菜单;2:按钮
	 * 
	 */
	private Integer type;

	/**
	 * 
	 * 资源url
	 * 
	 */
	private String sourceUrl;

	/**
	 * 
	 * 层级
	 * 
	 */
	private Integer level;

	/**
	 * 
	 * 排序
	 * 
	 */
	private Integer sort;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parent_id")
	private SysResource parent;

	public String getSourceName() {
		return sourceName;
	}

	public void setSourceName(String sourceName) {
		this.sourceName = sourceName;
	}

	public String getSourceKey() {
		return sourceKey;
	}

	public void setSourceKey(String sourceKey) {
		this.sourceKey = sourceKey;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getSourceUrl() {
		return sourceUrl;
	}

	public void setSourceUrl(String sourceUrl) {
		this.sourceUrl = sourceUrl;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}
	
	public SysResource getParent() {
		return parent;
	}

	public void setParent(SysResource parent) {
		this.parent = parent;
	}

}
